home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OMEGA & Dilbert Too!
/
OMEGA and Dilbert Too!.iso
/
Omega
/
OMEGA
/
SWDEMO
/
SWDWBWI.EXE
/
INST.MST
< prev
next >
Wrap
Text File
|
1994-02-24
|
7KB
|
281 lines
'**************************************************************
'** DASYTEC Installation WorkBench for Windows DEMO Englisch **
'**************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
const WELCOME = 100
const ASKQUIT = 200
const DESTPATH = 300
const EXITFAILURE = 400
const EXITQUIT = 600
const EXITSUCCESS = 700
const APPHELP = 900
const TOOBIG = 6300
const BADPATH = 6400
''Bitmap ID
const LOGO = 1
global DEST$ ''Default destination directory.
global WINPFAD$ ''Windows-Verzeichnis
global OPTCUR$ ''Option selection from option dialog.
global SEINTRAG$ ''Eintraege in SYSTEM.INI
global EINTRAGU$ ''Hilfsstring
global sxx% ''Hilfsvariable zu Eintrag in SYSTEM.INI
'' 0=Kein Eintrag, 1=Eintrag gendert
global xx% ''Hilfsvariable
global size& ''Freier Platz auf Disk
global hWnd%
declare function Ctl3dRegister LIB "CTL3D.DLL" (hWnd%) as integer
declare function Ctl3dAutoSubclass LIB "CTL3D.DLL" (hWnd%) as integer
declare function Ctl3dUnregister LIB "CTL3D.DLL" (hWnd%) as integer
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
hWnd% = HwndFrame ()
xx% = Ctl3dRegister (hWnd%)
xx% = Ctl3dAutoSubclass (hWnd%)
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Installation WorkBench PC for Windows with DEMO Driver"
WINPFAD$ = GetWindowsDir
szInf$ = GetSymbolValue("STF_SRCINFPATH")
if szInf$ = "" then
szInf$ = GetSymbolValue("STF_CWDDIR") + "INST.INF"
end if
ReadInfFile szInf$
OPTCUR$ = "1"
DEST$ = "C:\WBW_DEMO"
'$ifdef DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
if IsDriveValid(WinDrive$) = 0 then
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
goto QUIT
end if
'$endif ''DEBUG
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
if sz$ = "CONTINUE" then
UIPop 1
else
gosub ASKQUIT
goto WELCOME
end if
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "end"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
if sz$ = "CONTINUE" then
if IsDirWritable(DEST$) = 0 then
gosub BADPATH
goto GETPATHL1
end if
eintragu$=mid$(dest$,1,1)
size&=GetFreeSpaceForDrive(eintragu$)
size&=size& / 1024
if size& < 2500 then
gosub DISKZUKLEIN
goto GETPATHL1
end if
UIPop 1
elseif sz$ = "REACTIVATE" then
goto GETPATHL1
elseif sz$ = "BACK" then
UIPop 1
goto WELCOME
else
gosub ASKQUIT
goto GETPATH
end if
Install
QUIT:
ON ERROR goto ERRQUIT
if ERR = 0 then
sz$ = UIStartDlg(CUIDLL$, EXITSUCCESS, "FInfoDlgProc", 0, "")
if sz$ = "REACTIVATE" then
goto QUIT
end if
UIPop 1
elseif ERR = STFQUIT then
sz$ = UIStartDlg(CUIDLL$, EXITQUIT, "FInfo0DlgProc", 0, "")
if sz$ = "REACTIVATE" then
goto QUIT
end if
else
sz$ = UIStartDlg(CUIDLL$, EXITFAILURE, "FInfo0DlgProc", 0, "")
if sz$ = "REACTIVATE" then
goto QUIT
end if
end if
UIPop 1
xx% = Ctl3dUnRegister (hWnd%)
end
ERRQUIT:
end
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
if sz$ = "REACTIVATE" then
goto BADPATH
end if
UIPop 1
return
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, asKQUIT, "FQuitDlgProc", 0, "")
if sz$ = "EXIT" then
UIPopAll
ERROR STFQUIT
elseif sz$ = "REACTIVATE" then
goto ASKQUIT
else
UIPop 1
end if
return
DISKZUKLEIN:
sz$ = UIStartDlg(CUIDLL$, TOOBIG , "FInfoDlgProc", 0, "")
if sz$ = "REAKTIVATE" then
goto DISKZUKLEIN
else
UIPop 1
end if
return
INST_RSTRT:
sxx%=0
open winpfad$+"WIN.INI" for input as #1
open winpfad$+"WIN.DSL" for output as #2
while not eof(1)
line input #1, seintrag$
if sxx%=0 then
eintragu$=ucase$(ltrim$(rtrim$(seintrag$)))
if eintragu$="[WINDOWS]" then
print #2,seintrag$
eintragu$="run="+ MakePath(Dest$,"_DLRSTOR.EXE")
print #2,eintragu$
sxx%=1
else
print #2,seintrag$
end if
else
print #2,seintrag$
end if
wend
close #1
close #2
if DoesFileExist(MakePath(winpfad$,"WIN.DSL"),femExist) then
RemoveFile MakePath(winpfad$,"WIN.INI"),cmoVital
RenameFile MakePath(winpfad$,"WIN.DSL"), "WIN.INI"
end if
eintragu$= GetSymbolValue("STF_CWDDIR")
open eintragu$+"_DLRSTOR.QFL" for output as #1
print #1,winpfad$
print #1,dest$
close #1
return
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
sub Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
WriteToLogFile "Eingabe Installationsverzeichnis: '" + DEST$ + "'"
WriteToLogFile "Erzeugtes Verzeichnis: " + DEST$
WriteToLogFile ""
AddSectionFilesToCopyList "Files", SrcDir$, DEST$
CopyFilesInCopyList
CreateProgmanGroup "Demo WBW", "", cmoNone
ShowProgmanGroup "Demo WBW", 1, cmoNone
CreateProgmanItem "Demo WBW", "WorkBench DEMO", MakePath(DEST$,"WRKBENCH.EXE"), "", cmoOverwrite
CreateProgmanItem "Demo WBW", "WorkBench Help", "winhelp.exe "+MakePath(DEST$,"eve_help.hlp"), "", cmoOverwrite
CloseLogFile
end sub
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualif ied path name.
'*************************************************************************
function MakePath (szDir$, szFile$) STATIC AS STRING
if szDir$ = "" then
MakePath = szFile$
elseif szFile$ = "" then
MakePath = szDir$
elseif MID$(szDir$, LEN(szDir$), 1) = "\" then
MakePath = szDir$ + szFile$
else
MakePath = szDir$ + "\" + szFile$
end if
end function